<template>
  <view class="personality-disadvantage">
    <view class="title-img-box">
      <image class="title-img" :src="partTextImgUrl" />
    </view>
    <view class="content-wrapper">
      <view class="content">
        <image class="center-img" :src="centerImg"></image>
        <view
          :class="['icon-item', 'item' + index]"
          v-for="(item, index) in dataItem"
          :key="index"
        >
          <image :src="item.url" class="icon"></image>
          <view class="icon-text">{{ item.label }}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    dataItem: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      partTextImgUrl:
        this.$imgBaseSelf + 'career/careerAssessNewImg/04_title.png',
      centerImg:
        this.$imgBaseSelf + 'career/careerAssessNewImg/04_center_img.png'
    };
  },
  mounted() {
    uni
      .createSelectorQuery()
      .in(this)
      .select('.personality-disadvantage')
      .boundingClientRect((rect) => {
        this.$emit('listenRect', rect);
      })
      .exec();
  }
};
</script>

<style lang="scss" scoped>
.personality-disadvantage {
  margin-top: 48rpx;
  position: relative;
  background: url($img-base + 'career/careerAssessNewImg/5_bg.png') no-repeat -10rpx
    60%;
  background-size: 110rpx 700rpx;
  width: 100%;
  .title-img-box {
    display: flex;
    justify-content: flex-end;
    .title-img {
      height: 112rpx;
      width: 470rpx;
    }
  }

  .content-wrapper {
    margin: -12rpx 32rpx 0 32rpx;
    background: #fff;
    border-radius: 20rpx 0rpx 0rpx 0rpx;
    .content {
      height: 517rpx;
      padding: 60rpx 42rpx 0 42rpx;
      background: linear-gradient(0deg, #ffffff 0%, #bff1b4 100%) no-repeat;
      border-radius: 20rpx 0rpx 0rpx 0rpx;
      border: 1px solid #ffffff;
      background-size: 100% 83rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      .icon-item {
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        .icon {
          width: 100rpx;
          height: 100rpx;
          margin-bottom: 8rpx;
        }
        .icon-text {
          font-family: Source Han Sans CN;
          width: 125rpx;
          font-weight: 600;
          font-size: 30rpx;
          color: #555555;
        }
      }
      .item0 {
        left: 90rpx;
        top: 110rpx;
      }
      .item1 {
        right: 100rpx;
        top: 18rpx;
      }
      .item2 {
        right: 100rpx;
        bottom: 40rpx;
      }
      .center-img {
        width: 282rpx;
        height: 316rpx;
      }
    }
  }
}
</style>
